let vfilter = {
  sex: data => data === 0 ? '女' : '男',
  fuwuType: data => data === 0 ? '轮牌' : '点客',
  cardType: value => value === 1 ? '期卡' : '疗程卡',
  dateTime: value => {
    let date = new Date(value * 1000)
    let Y = date.getFullYear(),
      m = date.getMonth() + 1,
      d = date.getDate()
    m = m < 10 ? '0' + m : m
    d = d < 10 ? '0' + d : d
    return Y + '-' + m + '-' + d
  },
  hourTime: value => {
    if (value === 0) {
      return ''
    }
    let date = new Date(value * 1000)
    let Y = date.getFullYear(),
      m = date.getMonth() + 1,
      d = date.getDate(),
      H = date.getHours(),
      i = date.getMinutes(),
      s = date.getSeconds()
    m = m < 10 ? '0' + m : m
    d = d < 10 ? '0' + d : d
    H = H < 10 ? '0' + H : H
    i = i < 10 ? '0' + i : i
    s = s < 10 ? '0' + s : s
    return Y + '-' + m + '-' + d + ' ' + H + ':' + i + ':' + s
  },
  orderName: value => {
    switch (value) {
      case 'LSD':
        return '消费单'
      case 'CZD':
        return '充值单'
      case 'KKD':
        return '开卡单'
      case 'SRD':
        return '收入单'
      case 'ZCD':
        return '支出单'
      case 'TKD':
        return '退卡单'
      case 'TQD':
        return '退款单'
    }
  },
  abs: value => {
    return Math.abs(value)
  },
  fixed: value => {
    return value.toFixed(2)
  }
}

export default vfilter
